Micron Document
`:top
`!Map`! is an `F33f`_`[idiom`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Programming_idiom]`_`f in `F33f`_`[parallel computing`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Parallel_computing]`_`f where a simple operation is applied to all elements of a sequence, potentially in parallel.`:cite-ref-1[`F5bf`_`[1`#cite-note-1]`_`f] It is used to solve `F33f`_`[embarrassingly parallel`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Embarrassingly_parallel]`_`f problems: those problems that can be decomposed into independent subtasks, requiring no communication/synchronization between the subtasks except a `F33f`_`[join`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Fork–join_model]`_`f or `F33f`_`[barrier`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Barrier_(computer_science)]`_`f at the end.

When applying the map pattern, one formulates an `*elemental function`* that captures the operation to be performed on a data item that represents a part of the problem, then applies this elemental function in one or more `F33f`_`[threads of execution`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Thread_(computing)]`_`f, `F33f`_`[hyperthreads`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Hyperthread]`_`f, `F33f`_`[SIMD lanes`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=SIMD_lanes]`_`f or on `F33f`_`[multiple computers`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Distributed_computing]`_`f.

Some parallel programming systems, such as `F33f`_`[OpenMP`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=OpenMP]`_`f and `F33f`_`[Cilk`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Cilk]`_`f, have language support for the map pattern in the form of a `!parallel for loop`!;`:cite-ref-2[`F5bf`_`[2`#cite-note-2]`_`f] languages such as `F33f`_`[OpenCL`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=OpenCL]`_`f and `F33f`_`[CUDA`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=CUDA]`_`f support elemental functions (as "`F33f`_`[kernels`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Compute_kernel]`_`f") at the language level. The map pattern is typically combined with other parallel design patterns. For example, map combined with category reduction gives the `F33f`_`[MapReduce`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=MapReduce]`_`f pattern.`:cite-ref-spp-3-0[`F5bf`_`[3`#cite-note-spp-3]`_`f]

>>Contents

• `F0af`_`[See also`#see-also]`_`f
• `F0af`_`[References`#references]`_`f

-─

>>See also

• `F33f`_`[Map (higher-order function)`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Map_(higher-order_function)]`_`f
• `F33f`_`[Functional programming`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Functional_programming]`_`f
• `F33f`_`[Algorithmic skeleton`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Algorithmic_skeleton]`_`f

>>References

`:cite-note-1`!1.`! `F0af`_`[↑`#cite-ref-1]`_`f `:citerefsamadijamshidileemahlke2014`aSamadi, Mehrzad; Jamshidi, Davoud Anoushe; Lee, Janghaeng; Mahlke, Scott (2014). `*Paraprox: Pattern-based approximation for data parallel applications`* (PDF). Proc. 19th Int'l Conf. on Architectural support for programming languages and operating systems. `F33f`_`[doi`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Doi_(identifier)]`_`f:10.1145/2541940.2541948.
`:cite-note-2`!2.`! `F0af`_`[↑`#cite-ref-2]`_`f `:citerefwolfe2015`aWolfe, Michael (6 April 2015). "Compilers and More: The Past, Present and Future of Parallel Loops". `*HPCwire`*.
`:cite-note-spp-3`!3.`! `F0af`_`[↑`#cite-ref-spp-3-0]`_`f `:citerefmichael-mccooljames-reindersarch-robison2013`aMichael McCool; James Reinders; Arch Robison (2013). `*Structured Parallel Programming: Patterns for Efficient Computation`*. Elsevier. `F33f`_`[ISBN`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=ISBN_(identifier)]`_`f 978-0124159938.

`c`F0af`_`[↑ Back to top`#top]`_`f`a